package com.skmc.okcashbag.common;

import android.R.style;
import android.app.Dialog;
import android.content.Context;
import android.graphics.drawable.AnimationDrawable;
import android.widget.ImageView;

import com.skmc.okcashbag.home.R;

public class LoadingDialog extends Dialog {
	AnimationDrawable spinAnim;
	public LoadingDialog(Context context) {  

		super(context,style.Theme_Panel);  
		
		setContentView(R.layout.progressbar);
		ImageView progressImg = (ImageView)findViewById(R.id.progressImg);
		progressImg.setBackgroundResource(R.anim.loading_progressbar);
	
		 
		spinAnim = (AnimationDrawable)progressImg.getBackground();
		
	}

	
	@Override
	public void onWindowFocusChanged(boolean hasFocus) {
		spinAnim.start();

		super.onWindowFocusChanged(hasFocus);
	}
	
	public AnimationDrawable getAnimation(){
		return this.spinAnim;
	}
	
}
